<?php

namespace addons\zzuser\controller\api;

use app\common\controller\Api;

class TestLoginById extends Api
{
    protected $noNeedLogin = 'index';
    protected $noNeedRight = 'index';

    public function index()
    {
        $config = get_addon_config('zzuser');
        if ($config['test_is'] == 'yes') {
            $id = input('id');
            $this->auth->direct($id);
            $this->success('', [
                'token' => $this->auth->getToken(),
            ]);
        }
    }
}
